package com.packet.controller;

import com.packet.pojo.Item;
import com.packet.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * @ClassName:GroupLeaderController
 * @Author: mu
 * @Date:2024-06-23 15:49
 * @Describe:
 */
@Controller
public class ItemController {
    @Autowired
    private ItemService itemService;
    @RequestMapping("/staff/getAllItem/{Gid}")
    public String getAllItem(@PathVariable int Gid, Model model, HttpSession session){
        session.setAttribute("Gid",Gid);
        List<Item> allItem = itemService.getAllItem();
        model.addAttribute("AllItem",allItem);
        System.out.println(allItem);
        return "/staff/Trip/allItem";
    }
}
